<link href="__CDN__/assets/addons/kuerp/css/common.css?v={$Think.config.site.version}" rel="stylesheet">

<style type="text/css">
    .btn-list {
        position: fixed;
        right: 40px;
    }
    .div-flex {
        display: flex
    }
    .div-flex .form-group {
        margin-right: 50px;
        text-align: center;
        line-height: 25px;
        margin-bottom: 0;
    }
    .tab-pane {
        border: 1px solid #F6F6F6;
    }
    .i-color {
        font-size: 34px;margin-right: 10px;color: #86C3FF;
    }
    .thumbnail {
        display: flow-root;
        width: max-content;
    }
    .thumbnail img {
        width: 50px;
        float: left;
        padding: 5px;
    }
    .text-color{
        color:#777;
    }
</style>
<style type="text/css">
    .examine_title{
        font-size: 14px;
        color: #333;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        display: block;
        height: 30px;
    }
    .examine_box{
        padding-left:20px;
        position: relative;
    }
    .examine_box .newicon{
        position: absolute;
        left:0;
        top:0;
        z-index: 2;
    }
    .examine_box .xian{
        width:1px;
        height:100%;
        background:#e6e6e6;
        position: absolute;
        left:4px;
        top:10px;
        z-index: 1;
    }
    .examine_box .examine_bg{
        position: relative;
        margin-top: 15px;
        border-radius: 4px;
        background-color: #f7f8fa;
        font-size: 12px;
        color: #929293;
        padding: 8px;
        line-height: 18px;
    }
    .rowbox{
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
    .stafflist{
        width: 70px;text-align: center;float: left;
    }
    .stafflist-right{
        width: 30px;text-align: center;float: left;margin: 0 20px;

    }
    .stafflist-right:last-child{
        display: none;
    }
    .stafflist img{
        width: 40px;
        height: 40px;
        margin: 10px;
        border-radius:50%;
    }
    .user-image{
        width: 40px;
        height: 40px;
        border-radius: 50%;

    }
</style>
{include file="kuerp/common/menu" /}
<div class="panel panel-default panel-intro">
    <input type="hidden" name="ids" id="ids" value="{$ids}"/>
    <div class="div-flex">
        <i class="fa fa-address-card i-color"></i>
        <div style="line-height: 35px">
            <b>{$row.purchase_code}</b>
            {switch name="row.examine_status"}
            {case value="0"}<b class="text-success">(审核中)</b>{/case}
            {case value="1"}<b class="text-warning">(审核通过)</b>{/case}
            {case value="2"}<b class="text-danger">(审核拒绝)</b>{/case}
            {default /}
            {/switch}
        </div>
        <div class="btn-list">
            {if condition="$row['examine_enable'] == true"}
            <a class="btn btn-warning" data-toggle="dropdown" id="examines" >审核</a>
            {/if}
            <a class="btn btn-success" data-toggle="dropdown" id="edits">编辑</a>
            {if condition="$row['enable_apply_score'] == 1"}
            <a class="btn btn-success" data-toggle="dropdown" id="apply_score">申请积分</a>
            {/if}

        </div>
    </div>

    <div style="margin-top: 10px">
    </div>
    <div class="row">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">审批流程:</label>
                <div class="col-xs-12 col-sm-10">
                    <ul class="layui-timeline">
                        {foreach name="log_list" item="vo"}
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <div><img src="{$vo.admin_avatar}" class="user-image"/></div>
                                <div>{$vo.cur_index}级审批 {$vo.admin_name}</div>
                                <div class="form-group {$vo.examine_status == 1 ? 'has-success' : 'has-error'}" style="margin:0"><label>{$vo.examine_status == 1 ? '审核通过' :'审核拒绝'} {$vo.remark != '' ? ' ('.$vo.remark.')' : ''}</label></div>
                                <div>{$vo.createtime}</div>
                            </div>
                        </li>
                        {/foreach}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="div-flex" style="margin-top: 20px">
        <div class="form-group">
            <span class="text-muted">订单编号</span>
            <p>{$row.purchase_code}</p>
        </div>

        <div class="form-group">
            <span class="text-muted">客户名称</span>
            <p>{if condition="isset($row.customers.customer_name)"}{$row.customers.customer_name}{/if}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">产品总金额</span>
            <p>{$row.money_tax_price + $row.back_money}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">销售金额</span>
            <p>{$row.all_money}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">返款金额</span>
            <p>{$row.back_money}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">已收款金额</span>
            <p>{$row.repayment_money}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">未回款金额</span>
            <p style="color: red">{$row.no_money}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">单据日期</span>
            <p>{$row.purchase_time}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">销售员</span>
            <p>{if condition="isset($row.sale_user_name)"}{$row.sale_user_name}{/if}</p>
        </div>
    </div>
    <div>

        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#basic" aria-controls="profile" role="tab" data-toggle="tab">基本信息</a></li>
            <li role="presentation"><a href="#product" aria-controls="profile" role="tab" data-toggle="tab">产品明细</a></li>
            <li role="presentation"><a href="#settings2" aria-controls="profile" role="tab" data-toggle="tab">回款信息</a></li>
            <li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">操作记录</a></li>
        </ul>

        <div class="tab-content" style="overflow-y: scroll;height:565px">
            <div role="tabpanel" class="tab-pane active in fade panel-body form-horizontal" id="basic">
                <div class="form-group">
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">单据编号:</span>
                            <span class="text-black">{$row.purchase_code}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">客户:</span>
                            <span class="text-black">{$row.customers.customer_name}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">客户联系人:</span>
                            <span class="text-black">{$row.customers.connet_name}-{$row.customers.customer_mobile}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">收货地址:</span>
                            <span class="text-black">{$row.receiving_address}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">单据日期:</span>
                            <span class="text-black">{$row.purchase_time}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">销售员:</span>
                            <span class="text-black">{$row.sale_user_name}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">购买类型:</span>
                            <span class="text-black">{$row.buy_type}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">购买版本:</span>
                            <span class="text-black">{$row.buy_version}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">锁编码:</span>
                            <span class="text-black">
                                {if condition="!empty($row.serial_data)"}
                                {foreach name="row.serial_data" item="vo"}
                                <div style="padding:5px;margin-right:5px;">{$vo.serial}{if condition="!empty($vo.lock_code)"}-{$vo.lock_code}{/if}</div>
                                {/foreach}
                                {/if}
                            </span>
                        </div>
                    </div>
                    <!-- <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">锁编码:</span>
                            <span class="text-black">{$row.serials}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">锁内码:</span>
                            <span class="text-black">{$row.lock_code}</span>
                        </div>
                    </div> -->
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">票据:</span>
                            <span class="text-black">{$row.receipt}</span>
                        </div>
                    </div>
                    <div class="col-xs-6 col-sm-5">
                        <div class="form-group col-sm-10">
                            <span class="text-muted">备注:</span>
                            <span class="text-black">{$row.note}</span>
                        </div>
                    </div>
                </div>
            </div>
            <div role="tabpanel" class="tab-pane fade panel-body" id="product">
                <table id="operation_product" class="table table-striped table-bordered table-hover table-nowrap"
                       width="100%">
                </table>
            </div>
            <div role="tabpanel" class="tab-pane fade panel-body" id="settings2">
                <div class="panel panel-info">
                    <div class="panel-heading">回款记录</div>
                    <div class="panel-body">
                        <table id="receivables" class="table table-striped table-bordered table-hover table-nowrap"
                               width="100%">
                        </table>
                    </div>
                </div>
            </div>
            <div role="tabpanel" class="tab-pane fade panel-body" id="settings4">
                <table id="operation_log" class="table table-striped table-bordered table-hover table-nowrap"
                       width="100%">
                </table>
            </div>
        </div>

    </div>
</div>